<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!doctype html>
<html lang="zh-CN">
<body>
	<h2>jms创建券</h2>

	<input placeholder="mobile" id="mobile" />
	<input placeholder="加息券ID" id="rate_def_id" />
	<input placeholder="现金券ID" id="cash_def_id" />
	<input placeholder="备注" id="summary" />
	<div>
		<button id="btnSend">发送</button>
	</div>
	<script src="../static/jquery-1.11.0.js"></script>
	<script type="text/javascript">
		$(function() {
			$("#btnSend").click(function() {

				var p = {
					t : new Date(),
					mobile : $("#mobile").val().trim(),
					cash_def_id : $("#cash_def_id").val().trim(),
					rate_def_id : $("#rate_def_id").val().trim(),
					summary : $("#summary").val().trim(),
				};

				$.post("jms_create_coupon.htm", p, function(data) {
					if (data.code == "SUCCESS") {
						$("#mobile").val("");
						$("#rate_def_id").val("");
						$("#cash_def_id").val("");
						$("#summary").val("");
						return;
					}
					alert(JSON.stringify(data));
				}, "json");
			});
		});
	</script>
</body>
</html>
